<template>
  <div class="big_box">
    <div class="vv">
      <my-swiper :list="list" autoplay></my-swiper>
    </div>
    <div class="box_small">
      <ul class="uu_nav">
        <li @click="add_qian">
          <img src="../assets/image/03.png" alt="" />
          <p>签到</p>
        </li>
        <li @click="add_li">
          <img src="../assets/image/01.png" alt="" />
          <p>礼券</p>
        </li>
        <li @click="add">
          <img src="../assets/image/icon.png" alt="" />
          <p>砍价</p>
        </li>
        <li @click="add_Zhuan">
          <img src="../assets/image/02.png" alt="" />
          <p>专栏</p>
        </li>
      </ul>
    </div>
    <div class="product">
      <div @click="add">
        <p>全民砍价</p>
        <i class="van-icon van-icon-arrow"></i>
      </div>
      <ul class="uu_box">
        <li>
          <div class="small_vv">
            <img
              src="https://dcdn.it120.cc/2019/07/24/e2d4f82f-f9af-48ff-9865-61561fd4c2f1.jpg"
              alt=""
              class="img_pic"
            />
            <div>
              <p>重返校园 男式连帽牛仔外套</p>
              <p>复古校园感，青春活力</p>
              <ol>
                <li>
                  <p>￥0.9</p>
                  <p>低价</p>
                </li>
                <li>
                  <p>￥1</p>
                  <p>原价</p>
                </li>
                <li>
                  <p>200件</p>
                  <p>限量</p>
                </li>
              </ol>
            </div>
          </div>
        </li>
      </ul>
    </div>
    <div>
      <div id="choiceness">
        <div @click="add_Zhuan">
          <p>精选专题</p>
          <i class="van-icon van-icon-arrow"></i>
        </div>
      </div>
      <div class="isc">
        <ul>
          <li v-for="item in pi" :key="item.id" @click="change(item)">
            <img :src="item.pic" alt="" />
            <p>{{ item.title }}</p>
            <p class="pl">{{ item.descript }}</p>
          </li>
        </ul>
      </div>
    </div>
    <div>
      <div id="home_popularity">
        <div @click="add_ren">
          <p>人气推荐</p>
          <i class="van-icon van-icon-arrow"></i>
        </div>
        <ul>
          <li v-for="item in lists" :key="item.id" @click="add_list(item)">
            <img :src="item.pic" alt="" />
            <p>{{ item.name }}</p>
            <p>{{ item.characteristic }}</p>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import { getbanner, getlist, getfen } from "@/utils/api/home.js";
import mySwiper from "@/components/Tools/Swiper/Swiper.vue";
export default {
  data() {
    return {
      list: [],
      pi: [],
      lists: [],
    };
  },
  mounted() {
    getbanner().then((res) => {
      console.log(res);
      this.list = res.data;
    });
    getlist().then((res) => {
      console.log(res);
      this.pi = res.data;
    });
    getfen().then((res) => {
      console.log(res);
      this.lists = res.data.data.goodsMap;
    });
  },
  components: {
    mySwiper,
  },
  methods: {
    add() {
      this.$router.push("/shorliat");
    },
    change(item) {
      this.$router.push({ path: "/xiang", query: { obj: item } });
    },
    add_Zhuan() {
      this.$router.push("/zhuan");
    },
    add_qian() {
      this.$router.push("/qian");
    },
    add_li() {
      this.$router.push("/liquan");
    },
    add_ren() {
      this.$router.push("/ren");
    },
    add_list(item) {
      this.$router.push({ path: "/renxiang", query: { obj: item } });
    },
  },
};
</script>

<style lang='scss'>
body {
  background: rgb(245, 245, 245);
}
.big_box {
  margin-bottom: 63px;
}
.my-swipe {
  width: 100%;
  height: 300px;
  .pic {
    width: 100%;
  }
}
.box_small {
  width: 100%;
  height: 115px;
  background: rgb(255, 255, 255);
  position: relative;
  top: -30px;
  border-radius: 20% 20% 0 0;
  line-height: 50px;
}
.uu_nav {
  display: flex;
  font-size: 0.4rem;
  justify-content: center;
  justify-content: space-around;
  > li {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    img {
      margin-top: 20px;
      width: 0.8rem;
    }
  }
}
.product {
  width: 100%;
  border-bottom: 0.14rem solid #f5f5f5;
  > div {
    margin-top: -15px;
    background: white;
    font-size: 0.3rem;
    display: flex;
    -webkit-box-pack: justify;
    justify-content: space-between;
    padding: 0 2.9rem;
    -webkit-box-align: center;
    align-items: center;
    text-align: center;
    height: 0.93rem;
    border-bottom: 0.01rem solid #e9e8e8;
  }
}
.img_pic {
  width: 2.28rem;
  height: 2.28rem;
  border-radius: 0.06rem;
  display: block;
}
.uu_box > li > div > div {
  margin-left: 0.14rem;
}
.product > ul > li > div > div > p:nth-of-type(1) {
  font-size: 0.2rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.product > ul > li > div > div > p:nth-of-type(2) {
  font-size: 0.15rem;
  color: #b2b2b2;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  margin-top: 0.1rem;
}
.product > ul > li > div > div > ol {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  margin-top: 13px;
}
.product > ul > li > div > div > ol li {
  text-align: center;
  margin-left: 0.5rem;
  margin-top: 0.46rem;
}
.product > ul > li > div > div > ol > li:nth-of-type(1) {
  margin-left: 0;
}
.product > ul > li > div > div > ol li {
  text-align: center;
  margin-left: 0.5rem;
  margin-top: 0.46rem;
}
.product > ul > li > div > div > ol > li:nth-of-type(1) > p:nth-of-type(1) {
  color: #d00000;
  font-weight: 700;
}
.product > ul > li > div > div > ol li > p:nth-of-type(1) {
  color: #b2b2b2;
  font-size: 0.3rem;
}
.product > ul > li > div > div > ol > li:nth-of-type(1) > p:nth-of-type(2) {
  color: #000000;
}
.product > ul > li > div > div > ol li > p:nth-of-type(2) {
  color: #b2b2b2;
  font-size: 0.3rem;
  margin-top: 0.06rem;
}
.product > ul > li > div > div > ol li > p:nth-of-type(1) {
  color: #b2b2b2;
  font-size: 0.3rem;
}
.product > ul > li > div > div > ol li > p:nth-of-type(2) {
  color: #b2b2b2;
  font-size: 0.3rem;
  margin-top: 0.06rem;
}
.small_vv {
  background: white;
  display: flex;
  padding: 0.1rem;
  border-bottom: 0.01rem solid #e9e9e9;
}
#choiceness {
  width: 100%;
  border-bottom: 0.14rem solid #f5f5f5;
  > div {
    margin-top: 8px;
    background: white;
    font-size: 0.3rem;
    display: flex;
    -webkit-box-pack: justify;
    justify-content: space-between;
    padding: 0 2.9rem;
    -webkit-box-align: center;
    align-items: center;
    text-align: center;
    height: 0.93rem;
    border-bottom: 0.01rem solid #e9e8e8;
  }
}
.isc {
  overflow-x: scroll;
  width: 100%;
  height: 5rem;
  display: block;
  background: white;
}
.isc > ul {
  display: flex;

  > li {
    width: 318.75px;
    height: 4.09rem;
    margin-left: 0.12rem;
    > img {
      width: 318.75px;
      height: 4.09rem;
      display: block;
      border-radius: 0.06rem;
    }
    > p {
      width: 4.7rem;
      font-size: 0.2rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
}
.pl {
  color: #a8a8a8;
}
#home_popularity {
  width: 100%;
  border-bottom: 0.14rem solid #f5f5f5;
  > div {
    margin-top: 8px;
    background: white;
    font-size: 0.3rem;
    display: flex;
    -webkit-box-pack: justify;
    justify-content: space-between;
    padding: 0 2.9rem;
    -webkit-box-align: center;
    align-items: center;
    text-align: center;
    height: 0.93rem;
    border-bottom: 0.01rem solid #e9e8e8;
  }
}

#home_popularity > ul > li > p:nth-of-type(1) {
  font-size: 0.3rem;
  color: #000000;
  width: 2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#home_popularity > ul > li > p:nth-of-type(2) {
  font-size: 0.14rem;
  color: #b2b2b2;
  width: 2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 0.1rem;
}
#home_popularity > ul {
  width: 100%;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-around;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
}
#home_popularity > ul > li img {
  width: 168.02px;
  height: 216.34px;
  display: block;
}
</style>
